import BTAction from "../../Base/BTAction";
import { NodeStatus, StateTypeEnum } from "../../../common/Enum";
import Boss1Tree from "../Tree/Boss1Tree";
import { GameLogic } from "../../../Runtime/GameLogic";

export default class ActionRun extends BTAction {

    constructor(
        private tree: Boss1Tree
    ) {
        super()
    }
    onStart(): void {
        this.tree.enemy.state = StateTypeEnum.run
        this.tree.enemy.targetPos = GameLogic.Ins.state.actors[0].position
        super.onStart()
    }

    onEnd(): void {
        super.onEnd()
    }

    onUpdate(): NodeStatus {
        return NodeStatus.Success
    }
}